package DataSetPackage;

/**
 * A <code>View</code> used when classifying simple hierarchies such as <code>SimpleHierarchy</code> or <code>SuffixHierarchy</code>.
 *
 * @author Martin Haulrich
 */
public class SimpleView implements View {

    /**
     * The indices for the parts of the features-list of a data-point that is relevant in this view.
     */
    int index;

    /**
     * The dataset this view refers to.
     */
    DataSet data;

    /**
     * Constructor
     * @param indices The indices for the parts of the features-list of a data-point that is relevant in this view.
     * @param data The indices for the parts of the features-list of a data-point that is relevant in this view.
     */
    public SimpleView(int index, DataSet data) {
        this.index = index;
        this.data = data;
    }

    @Override
    public DataSet getDataSet() {
        return data;
    }

    /**
     * Returns the revelant feature for the given ID.
     * @returnRelevant feature.
     * @param dataID ID of data point to get relevant feature for.
     */
    public String getFeature(Integer dataID) {

        return data.getFeatures(dataID).get(index);


    }
}
